<?php


namespace App\Http\Model\Auth;


use Illuminate\Support\Facades\DB;

class LoginModel
{


    /**
     * 获取指定管理员信息
     *
     * @param string $workcode
     *
     * @return array
     */
    public static function admin(string $workcode)
    {
        $info = DB::select('SELECT `id`,`workcode`,`username`,`is_disable`,`pfs_dw_id` FROM `admin` WHERE `workcode`=:workcode AND `is_del`=0', [
            'workcode' => $workcode
        ]);
        return empty($info) ? [] : (array) current($info);
    }


    /**
     * PC-查询管理员
     *
     * @param string $workcode
     *
     * @return array|mixed
     */
    public static function login(string $workcode)
    {
        $info = DB::select('SELECT `id`,`workcode`,`username`,`is_disable` FROM `admin` WHERE `workcode`=:workcode AND `is_del`=0', [
            'workcode' => $workcode
        ]);
        return empty($info) ? [] : (array) current($info);
    }
}





/**
 * LoginModel.php
 *
 * 说明:
 *
 * 修改历史
 * ----------------------------------------
 * 2021/6/4 14:09:00   操作:创建
 **/
